#-*-coding: utf-8 -*-
import pymysql

db = pymysql.connect(host="localhost", user="root", passwd="123456", database="pythondata", charset="utf8")
print('服务器连接成功!')

sql = 'select * from test'

cursor = db.cursor()

cursor.execute(sql)

datas = cursor.fetchall()
datas = list(datas)
print(type(datas))

for data in datas:
    print(data)